#pragma once

#include <cstdint>
#include <string>
#include "tinyXML/tinyxml.h"

class TinyXmlWrapper
{
public:
    static bool readAttribute(const TiXmlElement *element, const char *name, std::int32_t &value);
    static bool readAttribute(const TiXmlElement *element, const char *name, std::uint32_t &value);
    static bool readAttribute(const TiXmlElement *element, const char *name, std::int16_t &value);
    static bool readAttribute(const TiXmlElement *element, const char *name, std::uint16_t &value);
    static bool readAttribute(const TiXmlElement *element, const char *name, bool &value);
    static bool readAttribute(const TiXmlElement *element, const char *name, std::string &value);

    static void writeAttribute(TiXmlElement *element, const char *name, std::int32_t value);
    static void writeAttribute(TiXmlElement *element, const char *name, std::uint32_t value);
    static void writeAttribute(TiXmlElement *element, const char *name, std::int16_t value);
    static void writeAttribute(TiXmlElement *element, const char *name, std::uint16_t value);
    static void writeAttribute(TiXmlElement *element, const char *name, bool value);
    static void writeAttribute(TiXmlElement *element, const char *name, const std::string &value);
};

